<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>维护店面</title>
<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css">
<SCRIPT src="sys/js/include/Calendar2.js"></SCRIPT>
<link href="sys/css/banzu.css" rel="stylesheet" type="text/css"  >
</head>
<body class="ridgeBody" >
<script language="javascript">
	
function dodelete(vgid){
		if (confirm("是否确认删除？删除后数据不可见！")){
		  document.queryFrom.action = "hr/visitorScoreDeleteDo.action?vgid="+vgid;
		  document.queryFrom.submit();
		}else { 
		  return false;
		 }
	}

function edit(vgid){
	  document.queryFrom.action = "hr/searchById.action?vgid="+vgid;
	  document.queryFrom.submit();
	
}

function excel(){
	document.queryFrom.target="_blank";
	document.queryFrom.action="hr/visitorScoreExportExcel.action";
	document.queryFrom.submit();
	document.queryFrom.target="";
	document.queryFrom.action="hr/initSearchVisitorScore.action";
}

var xmlhttpPop;
var areaNowPop;
function selectAreaPop(areaCode,areaValue,area){
	areaNowPop = area;
	var url = "";
				 
	xmlhttpPop=createXmlPop();
	if (xmlhttpPop==null) {
    	alert ("您的浏览器不支持AJAX！");
    	return;
    }
   
    if(areaNowPop=='emp_area')
  		url="hr/ajaxGetAreaList.action?queryAreaCode="+areaCode+"&sid="+Math.random();
  	if(areaNowPop=='emp_province')
  		url="hr/ajaxGetCityList.action?queryAreaCode="+areaCode+"&sid="+Math.random();

  	if(url!=""){
	  xmlhttpPop.onreadystatechange=areaChangedPop;
	  xmlhttpPop.open("GET",url,true);
	  xmlhttpPop.send(null);
  }
}

function createXmlPop(){
	var xmlhttpd;
	try{
		xmlhttpd= new ActiveXObject('msxml2.xmlhttp');
	}catch(e){
		try{
			xmlhttpd=new ActiveXObject('Microsoft.xmlhttp');
		}catch(e){
		 	try{
		 		xmlhttpd=new XMLHttpRequest();
			}catch(e){}
		}
	}
	return xmlhttpd;
}

function chuxun(){
	var starttime = document.getElementById("starttime");
	var endtime = document.getElementById("endtime");
	if(starttime.value != "" && endtime.value == "") {
		alert("请输入结束时间！");
		return;			
	}
	if(starttime.value == "" && endtime.value != "") {
		alert("请输入开始时间！");
		return;
	}
	if(starttime.value != "" && endtime.value !="") {
		if(starttime.value >= endtime.value) {
			alert("结束时间必须大于开始时间！");
			return;
		}
	}
	document.queryFrom.submit();
}
</script>

<table width="100%" >
<tr><td> 
 <form name="queryFrom" method="post" action="hr/initSearchVisitorScore.action"> 
 	<input name="curpage" type="hidden" class="input" value="1">
 <fieldset align='left' style="width:500"> 
  <legend><font  size="2"><img src="sys/images/getpic.gif"> 请选择查询条件</font></legend>
   <table id="tab4" style="display:block;" class="datatable" width="500" cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE'>
  	<tr>
		<td height="26" colspan="4"  class="dataTitle">查询神秘访客评分信息</td>
	 </tr>
	<tr>
		<td height="26" with="25%" nowrap="nowrap" class="datatr1"><span class="STYLE1" ></span>区域：</td>
		<td height="26" with="25%">
			<select class="selectwidth" name="areaCode" value="${areaValue}" onChange="selectAreaPop(this.options[selectedIndex].value,this.options[selectedIndex].text,'emp_area')"  >
				<option value="" selected>请选择</option>
				<c:forEach items="${areas}" var="area">
					<option value="${area.areaValue}" <c:if test="${area.areaValue==areaValue}">selected</c:if>>${area.areaValue}</option>	
				</c:forEach>
			</select>
		</td>
		<td height="26" with="25%" nowrap="nowrap" class="datatr1"><span class="STYLE1"></span>省份：</td>
		<td height="26" with="25%">
			<select class="selectwidth" name="provinceCode"  value="${provinceName}" onChange="selectAreaPop(this.options[selectedIndex].value,this.options[selectedIndex].text,'emp_province')">
				<option value="" selected>请选择</option>
				<c:forEach items="${provinces}" var="province">
					<option value="${province.provinceName}" <c:if test="${province.provinceName==provinceName}">selected</c:if>>${province.provinceName}</option>	
				</c:forEach>
			</select>
		</td>
	</tr>
	 <tr>
        	<TD height="22" valign="top" nowrap class="datatr1"> 督导：</TD>	
			<TD valign="top" nowrap > 
	      		<input name="ctm" type="text" class="input" value="${ctm}"/> 	</TD>
	     	<TD height="22" valign="top" nowrap class="datatr1"> 店面名称：</TD>	
			<TD valign="top" nowrap > 
	      		<input name="shopName" type="text" class="input" value="${shopName}"/> 	</TD>
 	 </tr>
 	  <tr>
 		<td width="25%" height="22" valign="top" nowrap class="datatr1">开始日期：<font color="#FF0000"></font></td>
					<td valign="top" nowrap class="tabimputright">       
						<input name="starttime" type="text" class="input" onclick="setday(this)" value="${starttime}"} readOnly />
	    			</td>
	    <td width="25%" height="22" valign="top" nowrap class="datatr1">结束日期：<font color="#FF0000"></font></td>
					<td valign="top" nowrap class="tabimputright">       
						<input name="endtime" type="text" class="input" onclick="setday(this)" value="${endtime}" readOnly />
	    			</td>
 	 </tr>
 	 <tr>
		<td height="25" colspan="4"  class="dataTitle"><input type="button" name="chaxun" onclick="chuxun()" value="查询" ></td>
	</tr>
</table>
</fieldset>
</form>
</td></tr> <tr ><td width="100%"  >
<table width="100%" cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE' class="datatable">
	<tr>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;操作&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;区域&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;Shop ID&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;年月&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;督导&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;省份&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;城市&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;城市级别&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;经销商名称&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;店面名称&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;店面地址&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;位置编码&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;Acer店面等级&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;品类店/专卖店&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;突发事件&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;店面总得分&nbsp;</td>
		<td height="22" nowrap class="dataTitle" align="center">&nbsp;录入人&nbsp;</td>
	</tr>
	<c:forEach items="${pageBean.map}" var="map">
	<tr class="datatr" align="center" onMouseOver=this.className='udatatr' onMouseOut=this.className='datatr'>
		 <td class="Table_tool"><%-- <IMG border=0 SRC='sys/images/edit.gif'  onClick="edit('${map.vgid}')" alt='编辑' style="cursor:hand">--%>
		 <IMG border=0 SRC='sys/images/del.gif'  onClick="dodelete('${ map.vgid}')" alt='删除' style="cursor:hand"></td>
		 <td nowrap="nowrap" class="Table_str" >${map.visitor_area}&nbsp;</td>
		  <td nowrap="nowrap" class="Table_str" >${map.shop_code}&nbsp;</td>
		  <td nowrap="nowrap" class="Table_str" >${map.v_date}&nbsp;</td>
		 <td nowrap="nowrap" class="Table_str" >${map.v_oversee}&nbsp;</td>
		  <td nowrap="nowrap" class="Table_str" >${map.v_province}&nbsp;</td>
  		<td nowrap="nowrap" class="Table_str" >${map.v_city}&nbsp;</td>
		  <td nowrap="nowrap" class="Table_str" >${map.v_city_level}&nbsp;</td>
		 <td nowrap="nowrap" class="Table_str" >${map.v_dealer_name}&nbsp;</td>
		<td nowrap="nowrap" class="Table_str" >${map.v_shop_name}&nbsp;</td>
		<td nowrap="nowrap" class="Table_str" >${map.v_shop_address}&nbsp;</td>	
		<td nowrap="nowrap" class="Table_str" >${map.v_position_code}&nbsp;</td>		
		<td nowrap="nowrap" class="Table_str" >${map.v_acershop_level}&nbsp;</td>
		<td nowrap="nowrap" class="Table_str" >${map.v_emergency}&nbsp;</td>	
		<td nowrap="nowrap" class="Table_str" >${map.v_sum_grade}&nbsp;</td>	
		  <td nowrap="nowrap" class="Table_str" >${map.v_record_name}&nbsp;</td>
	</tr>
	</c:forEach>
	<c:if test="${pageBean.page.rowTotal>0}">
	<tr>
		<td height="20" colspan="20">
			<jsp:include page="/sys/include/page.jsp" flush="true"/> 
		</td>
	</tr>
	</c:if> 
 </table>
 </td></tr>	
</table>

</body>
</html>
